import request from '@/utils/request'

export function loginByUsername(phone, password) {
  const data = {
    phone,
    password
  }
  return request({
    url: '/backend/adminuser/dologin',
    method: 'get',
    params: data
  })
}

export function logout() {
  return request({
    url: '/login/logout',
    method: 'get'
  })
}

export function getUserInfo() {
  return request({
    url: '/backend/adminuser/get-user-info',
    method: 'get'
  })
}

// 图形验证码
export function imgVerify() {
  return request({
    url: '/public/get-verify-image',
    method: 'get'
  })
}
// 判断短信验证码
export function messageVerify(data) {
  return request({
    url: '/backend/adminuser/validate-phone',
    method: 'get',
    params: data
  })
}
// 重置密码
export function resetPassword(data) {
  return request({
    url: '/backend/adminuser/restpwd',
    method: 'get',
    params: data
  })
}

// 发送短信验证码
export function isPhone(data) {
  return request({
    url: '/backend/adminuser/send-sms-code',
    method: 'get',
    params: data
  })
}
// 注册完善信息
export function perfectInfo(data) {
  return request({
    url: '/backend/adminuser/improve-info',
    method: 'get',
    params: data
  })
}
